import unittest
from employee import Employee


class TestEmployee(unittest.TestCase):
    def setUp(self):
        """在每个测试方法执行前创建一个Employee实例"""
        self.employee = Employee('John', 'Doe', 50000)

    def test_give_default_raise(self):
        """测试默认的年薪增加量是否正确"""
        self.employee.give_raise()
        self.assertEqual(self.employee.annual_salary, 55000)

    def test_give_custom_raise(self):
        """测试自定义年薪增加量是否正确"""
        custom_raise_amount = 8000
        self.employee.give_raise(custom_raise_amount)
        self.assertEqual(self.employee.annual_salary, 58000)


if __name__ == '__main__':
    unittest.main()